<template>
  <div class="app-container">
    <!-- 题库管理-组题列表 -->
    <div class="top">
      <div>
        <el-form ref="form" :model="form" label-width="80px" :inline="true">
          <el-form-item label="关键字">
            <el-input v-model="form.keyword" placeholder="根据编号搜索"></el-input>
          </el-form-item>
        </el-form>      
      </div>
      <div>
        <el-button>清除</el-button>
        <el-button type="primary">搜索</el-button>
      </div>
    </div>
    <!-- 提示 -->
    <el-alert
      :title="`数据一共${total}条`"
      type="info"
      :closable="false"
      show-icon>
    </el-alert>
    <!-- 表格 -->
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="id" label="编号" width="180"></el-table-column>
      <el-table-column prop="questionType" label="题型" width="180"></el-table-column>
      <el-table-column prop="questionIDs" label="题目编号" width="180"></el-table-column>
      <el-table-column prop="addTime" label="录入时间" width="180"></el-table-column>
      <el-table-column prop="totalSeconds" label="答题时间(s)" width="180"></el-table-column>
      <el-table-column prop="accuracyRate" label="正确率(%)" width="180"></el-table-column>
      <el-table-column prop="userName" label="录入人" width="180"></el-table-column>
      <el-table-column label="操作" width="180"></el-table-column>
    </el-table>
  </div>
</template>

<script>
import {randomsList} from '@/api/questions'
export default {
  name: 'Randoms',
  data() {
    return {
      form: {
        page: 1,
        pagesize: 10
      },
      total: 0,
      tableData:[]
    }
  },
  mounted() {
    this.getTableData()
  },
  methods: {
    async getTableData() {
      await randomsList(this.form)
    }
  }
  
}
</script>

<style lang="scss" scoped>
.app-container {
  background-color: #fff;
  margin: 20px;
  .top {
    display: flex;
    justify-content: space-between;
    span {
      font-size: 12px;
      color: #ffc5da;
    }
  }
}
</style>